<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/template.xhtml">
	<ui:define name="title">Login</ui:define>
	<ui:define name="content">
		<div id="head" align="center">
			<h:outputText value="#{label.login}"
				style="font-size: 30px;" />
			<hr></hr>
		</div>
		<h:form id="loginForm">
			<table>
				<tr>
					<td><h:outputText value="#{label.email}" /></td>
					<td><h:inputText id="email" style="width:100%"
							value="#{loginAction.targetEntity.email}" required="true"
							validatorMessage="Validation Error: Invalid email address">
							<f:validateRegex
								pattern="^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$"></f:validateRegex>
							<rich:validator />
						</h:inputText></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="email" errorClass="error" />
					</td>
				</tr>
				<tr>
					<td><h:outputText value="#{label.password}" /></td>
					<td><h:inputSecret id="password" style="width:100%"
							value="#{loginAction.targetEntity.password}" required="true">
							<f:validateLength for="password" minimum="6" maximum="20" />
							<f:validateRequired />
							<rich:validator />
						</h:inputSecret></td>
				</tr>
				<tr>
					<td colspan="2"><rich:message for="password"
							errorClass="error" /></td>
				</tr>
			</table>
			<h:commandButton action="#{loginAction.login()}"
				value="#{label.login}" />
			<br />
			<rich:message for="loginForm" infoStyle="color: green;"
				errorStyle="color: red;" styleClass="errorMessage" />
			<br />
		</h:form>
		<h:form id="forgotPasswordForm">
			<h:commandLink value="#{label.forgotPassword}"
				action="forgotPassword"
				style="font-family:arial, verdana;font-size:12px;" />
		</h:form>
	</ui:define>
</ui:composition>
</html>

